<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 学习目标：掌握剩余参数和剩余属性 -->
  <script>
    function test(a, b, ...xxx) {
      // 剩余参数的数据类型：是数组
      console.log('a, b  ----->  ', a, b, xxx);
    }

    test(1, 3, 4, 10, 2, 6, 123)
    test(10, 2, 6, 123)


    // 剩余属性的数据类型：对象
    const obj = { name: "zs", age: 18, gender: "男", city: "广州" }
    const { name, age, ...yyy } = obj
    // yyy剩余属性
    console.log('yyy  ----->  ', yyy);

  </script>

</body>

</html>